<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.prime.com.tr/ui">
    <h:head>
        <title>Compose Message</title>
    </h:head>
    <h:form>
        <p:growl id="notif" showDetail="true"/>  
        <f:view beforePhase="#{UserDisplayManagedBean.doDisplay}">
            <h:body> 
                <!-- IDLE DIALOG for -->
                <p:confirmDialog message="You have been idle for 5 minutes. Do you want to continue?"  
                                 showEffect="bounce" hideEffect="explode"  
                                 header="Warning message" severity="alert" widgetVar="confirmation">  
                    <p:commandButton value="Yes" onclick="confirmation.hide()" type="button" /> 
                    <p:commandButton value="No" update="panel" oncomplete="confirmation.hide()"  
                                     actionListener="#{UserManagedBean.doLogout}" /> 
                </p:confirmDialog>
                <p:growl id="growl" showDetail="true"/> 

                <p:ajaxStatus style="width:16px;height:16px;">
                    <f:facet name="start">
                        <h:graphicImage value="25(2).gif" />
                    </f:facet>
                    <f:facet name="complete">
                        <h:outputText value="" />
                    </f:facet>
                </p:ajaxStatus>


                <div id="container" style="position:relative">
                    <div id="top" class="top">
                        <h:graphicImage value="/image/newHeader.jpg"/>
                    </div>
                    <div id="content">
                        <p:poll interval="3"   
                                actionListener="#{MessageManagedBean.checkNewMessage}" update="growl" />
                        <table>
                            <tr>                    
                                <td style="vertical-align:top">
                                    <p:toolbar style="font-size:80%;height:33px;width:207px"> 
                                        <p:toolbarGroup align="right">
                                            <p:button title="Home" image="ui-icon-home" outcome="ManufacturingDeptWorkspace"/>
                                            <p:button title="Notes" image="ui-icon-note" outcome="tasks"/>
                                            <p:button title="Mail" outcome="messages" image="ui-icon-mail-closed"/>     
                                            <p:button title="Edit Preferences" image="ui-icon-gear"/>
                                            <p:button title="Help" image="ui-icon-help"/>
                                            <p:commandButton immediate="true" type="submit" image="ui-icon-close" actionListener="#{UserManagedBean.doLogout}"/> 
                                        </p:toolbarGroup>
                                    </p:toolbar>

                                   <p:menu id="menu" style=" width:205px;height: 855px;font-family: Verdana;border-style: double;font-size: 80%">  
                                    <p:submenu label="Manufacturing Menu">  
                                        <p:menuitem value="Manufacturing Dept Home" url="http://localhost:8080/MerlionERP-war/MRP/ManufacturingDeptWorkspace.xhtml" ajax="false" icon="ui-icon ui-icon-home"/>  
                                    </p:submenu>
                                    <p:submenu label="Production Planning">
                                        <p:menuitem value="View Sales Record" url="http://localhost:8080/MerlionERP-war/MRP/SalesRecord.xhtml" ajax="false" icon="ui-icon ui-icon-search"/>  
                                        <p:menuitem value="View Sales Forecast" url="http://localhost:8080/MerlionERP-war/MRP/SalesForecast.xhtml" ajax="false" icon="ui-icon ui-icon-search" />
                                        <p:menuitem value="View Sales and Operation Plan" url="http://localhost:8080/MerlionERP-war/MRP/SalesAndOperationPlan.xhtml" ajax="false" icon="ui-icon ui-icon-search" />
                                    </p:submenu>
                                    <p:submenu label="Master Production Schedule">
                                        <p:menuitem value="View MPS Weekly" url="http://localhost:8080/MerlionERP-war/MRP/MasterProductionScheduleWeekly.xhtml" ajax="false" icon="ui-icon ui-icon-search" />
                                        <p:menuitem value="View MPS Daily" url="http://localhost:8080/MerlionERP-war/MRP/MasterProductionScheduleDaily.xhtml" ajax="false" icon="ui-icon ui-icon-search" />
                                        <p:menuitem value="Commit MPS" url="http://localhost:8080/MerlionERP-war/MRP/CommitMasterProductionSchedule.xhtml" ajax="false" icon="ui-icon ui-icon-search" />
                                    </p:submenu>
                                    <p:submenu label="Material Planning">
                                        <p:menuitem value="View Requirement Planning" url="http://localhost:8080/MerlionERP-war/MRP/MaterialRequirementPlanning.xhtml" ajax="false" icon="ui-icon ui-icon-search" />
                                    </p:submenu>
                                    <p:submenu label="Bill of Materials">
                                        <p:menuitem value="View Bill of Materials" url="http://localhost:8080/MerlionERP-war/MRP/BillOfMaterials.xhtml" ajax="false" icon="ui-icon ui-icon-search" />
                                    </p:submenu>
                                </p:menu>

                                <p:calendar mode="inline" style="font-size:11px;font-family:Tahoma"/>
                            </td>

                                <td style="font-family:Tahoma;font-size:12px;vertical-align:top" >
                                    
                                    <h:graphicImage value="write_email.png" style="width:40px;height:40px" />
                                    <h:outputText value="         "/>
                                    <h:outputText value="Compose Mail" style="font-family:Tahoma;font-size:20px;font-weight:bolder"/>
                                    <p:spacer width="100" height="10"/>
                                    <table width="100%" style="border: 1px solid lavender" cellpadding="3" cellspacing="3" >
                                       
                                        <tr>
                                            <td width="20%"> <h:outputLabel value="To" for="to" style="font-weight:bold"/></td>
                                            <td><h:outputText value=":"/></td>

                                            <td><p:inputText value="#{MessageManagedBean.receiverId}" style="width:100%"/></td>
                                        </tr>
                                        <tr>
                                            <td><h:outputText value="Subject" style="font-weight:bold"/></td>
                                            <td><h:outputText value=":"/></td>
                                            <td><p:inputText value="#{MessageManagedBean.title}" style="width:100%" /></td></tr>
                                        <tr><td  colspan="4" >
                                                <p:editor value="#{MessageManagedBean.body}" widgetVar="editor" width="1080"/>  </td>
                                        </tr>
                                    </table>

                                    <h:panelGrid columns="2" style="margin-top:10px;font-size:10px;font-family: Tahoma">  
                                        <p:commandButton value="Send" update="display" actionListener="#{MessageManagedBean.sendMessage}"  
                                                         image="ui-icon ui-icon-disk" />  
                                        <p:commandButton type="button" value="Clear" onclick="editor.clear()"  
                                                         image="ui-icon ui-icon-close" />  
                                    </h:panelGrid>  

                                </td>
                            </tr>
                        </table>
                    </div>
                    <div id="bottom" class="bottom" style="position:absolute;bottom:0">
                        <h:graphicImage value="/image/merlionfooter.jpg" />
                    </div>
                </div>

            </h:body>
        </f:view>
    </h:form>
</html>


